Skip to main content

AcceptCookies

The AcceptCookies component is a React component that displays a toast notification at the bottom of the screen, prompting the user to accept the Terms of Service and Privacy Policy. It uses the react-cookie library to manage a cookie that stores the user's acceptance status.

Usage

import AcceptCookies from '@site/src/components/AcceptCookies';

const MyComponent = () => {
return (
<div>
<AcceptCookies />
{/* Your other components */}
</div>
);
};

Component Structure

  • AcceptCookies: This functional component manages the state for cookie acceptance, refusal, and toast visibility. It uses useEffect to handle cookie logic and display the appropriate message.

Dependencies

  • react: Core React library.
  • react-bootstrap: Used for styling and layout (Accordion, Col, Row, Toast, ToastContainer).
  • react-cookie: Used for managing cookies.
  • react-icons: Used for displaying icons (FaHandshake, FaHandSpock).
  • ../CoolButton: A custom button component (assumed to be in the same directory).

Example

import React from 'react';
import AcceptCookies from '@site/src/components/AcceptCookies';

function Example() {
return (
<div>
<AcceptCookies />
</div>
);
}

Props

This component does not accept any props.